<%@ include file="/common/taglibs.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>My JSP 'userCount.jsp' starting page</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
		<link href="<%=path%>/ext/styles/style1/icon.css" rel="stylesheet"
			type="text/css">
		<link href="<%=path%>/ext/styles/style1/tabs.css" rel="stylesheet"
			type="text/css">
		<script type="text/javascript" src="http://www.google.com/jsapi">
</script>
		<script src="<%=path%>/ext/scripts/jquery/jquery-1.6.1.min.js"
			type="text/javascript">
</script>
		<script src="<%=path%>/ext/scripts/jquery/jquery.easyui.min.js"
			type="text/javascript">
</script>
		<script src="<%=path%>/ext/scripts/jquery/jquery.gvChart-1.0.1.min.js"
			type="text/javascript">
</script>
		<script type="text/javascript">
$(function() {
	$("#tabs").tabs();
});
</script>
		<script type="text/javascript">
gvChartInit();
function getListByProperties(strvalue) {
	return strvalue.split(',');
}
jQuery(document)
		.ready(
				function() {
					jQuery('#myTable1').gvChart( {
						chartType : 'AreaChart',
						gvSettings : {
							vAxis : {
								title : 'num'
							},
							hAxis : {
								title : 'danwei'
							},
							width : 720,
							height : 300
						}
					});
					var territoryvalue = "<fmt:message key='count.territory.info'/>";
					var gradevalue = "<fmt:message key='count.grade.info'/>";
					var countterritoryvalue = "<fmt:message key='count.pic.condition.info'/>";
					var countpicvalue = "<fmt:message key='count.pic.info'/>";

					var territorylist = getListByProperties(territoryvalue);
					var gradelist = getListByProperties(gradevalue);
					var countterritorylist = getListByProperties(countterritoryvalue);
					var countpiclist = getListByProperties(countpicvalue);

					for ( var i = 0; i < territorylist.length; i++) {
						jQuery('#territoryid').append(
								"<option value='" + (i + 1) + "'>"
										+ territorylist[i] + "</option>");
					}
					for ( var i = 0; i < gradelist.length; i++) {
						jQuery('#gradeid').append(
								"<option value='" + (i + 1) + "'>"
										+ gradelist[i] + "</option>");
					}
					for ( var i = 0; i < countterritorylist.length; i++) {
						jQuery('#countterritoryid').append(
								"<option value='" + (i + 1) + "'>"
										+ countterritorylist[i] + "</option>");
					}
					for ( var i = 0; i < countpiclist.length - 1; i++) {
						jQuery('#countpicid').append(
								"<option value='" + (i + 1) + "'>"
										+ countpiclist[i] + "</option>");
					}
				});
</script>
	</head>

	<body>
		<form:form action="reportcount/usercount.html" method="post">
			<table style="border-width: 1px;" width="900px">
				<tr>
					<td colspan="4">
						<fmt:message key="count.search.condition" />
					</td>
				</tr>
				<tr>
					<td>
						<fmt:message key="count.user.territory" />
					</td>
					<td align="left">
						<select id="territoryid" name="territory">
						</select>
					</td>
					<td>
						<fmt:message key="count.user.grade" />
					</td>
					<td align="left">
						<select id="gradeid" name="grade"></select>
					</td>
				</tr>
				<tr>
					<td>
						<fmt:message key="count.register.starttime" />
					</td>
					<td></td>
					<td>
						<fmt:message key="count.register.endtime" />
					</td>
					<td></td>
				</tr>
				<tr>
					<td>
						<fmt:message key="count.user.company" />
					</td>
					<td colspan="3">
						<input name="company" type="text" />
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<fmt:message key="count.group.condition" />
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<fmt:message key="count.user.territory" />
						<input type="checkbox" name="group" value="territory">
						<fmt:message key="count.user.company" />
						<input type="checkbox" name="group" value="company">
						<fmt:message key="count.grade" />
						<input type="checkbox" name="group" value="grade">
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<fmt:message key="count.order.condition" />
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<fmt:message key="count.user.territory" />
						<input type="checkbox" name="order" value="territory">
						<fmt:message key="count.user.company" />
						<input type="checkbox" name="order" value="company">
						<fmt:message key="count.grade" />
						<input type="checkbox" name="order" value="grade">
						<fmt:message key="count.num" />
						<input type="checkbox" name="orderNum">
					</td>
				</tr>
				<tr>
					<td colspan="4">
						<fmt:message key="count.order.asc" />
						<input type="radio" name="sortDesc" value="asc" />
						<fmt:message key="count.order.desc" />
						<input type="radio" name="sortDesc" value="desc" />
					</td>
				</tr>
			</table>
			<input name="ok" type="submit" value="okokok" />
		</form:form>
		<div>
			<form:form action="report/usercount.html" method="post">
				<div>
					<table>
						<tr>
							<td colspan="4">
								<select id="countterritoryid" name="countterritory"></select>
								<select id="countpicid" name="countpic"></select>
								<input type="submit" value="ok" />
							</td>
						</tr>
					</table>
				</div>
			</form:form>
			<c:if test="${userlistresult == 'true'}">
				<div class="easyui-tabs" fit="true" plain="true"
					style="height: 500px; width: 800px;">
					<div title="Title1" style="padding: 10px;">
						<h2 id="area">

						</h2>
						<table id='myTable1'>
							<caption>

							</caption>
							<thead>
								<tr>
									<th>
									</th>
									<c:forEach var="view" items="${userlists}">
										<th>
											${view.value}
										</th>
									</c:forEach>
								</tr>
							</thead>
							<tbody>
								<tr>
									<th>

									</th>
									<c:forEach var="view1" items="${userlists}">
										<td>
											${view1.num}
										</td>
									</c:forEach>
								</tr>
							</tbody>
						</table>
					</div>
				</div>
			</c:if>
		</div>
		<div>
			<display:table name="usercountlist" cellspacing="0" cellpadding="0"
				requestURI="" style="width:100%;" defaultsort="1" id="users"
				pagesize="5" class="table" export="true">
				<display:column property="territory" escapeXml="true"
					sortable="true" titleKey="count.user.territory.name" />
				<display:column property="company" escapeXml="true" sortable="true"
					titleKey="count.user.company.name" />
				<display:column property="grade" escapeXml="true" sortable="true"
					titleKey="count.user.grade" />
				<display:column property="num" escapeXml="true" sortable="true"
					titleKey="count.user.num" />
			</display:table>
		</div>
	</body>
</html>
